package com.system.boot.setting.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.system.api.setting.entity.po.SysDictItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DictItemMapper extends BaseMapper<SysDictItem> {

    /**
     * 查询绑定字典 值是否重复
     * @param dictCode 绑定字典编码
     * @param value 值
     * @return boolean
     * @author lslands
     * @date 2024/5/16 00:39
     */
    @Select("SELECT EXISTS(SELECT 1 FROM sys_dict_item WHERE dict_code=#{dictCode} AND value=#{value})")
    boolean getExistsByCode(String dictCode,String value);



    /**
     * 批量删除(物理)
     * @param ids ids集 | [1,2,3,4,5]
     * @return int
     */
    int deleteBatch(@Param("ids") List<Long> ids);
}